
package org.OpenGeoPortal.SiteSpecific;

/**
 * This interface holds the user authentication related methods.  
 * This interface will be used by the JSP that may display a login form and
 * the servlet that handles the login form submit.  
 * The concrete class will be created using Google Guice. 
 * 
 * //TODO consider how certificate based authentication will be will be handled
 * @author stevemcdonald
 *
 */
public interface UserAuthentication 
{
	
	/**
	 * typically used when logging in login a user with the credentials they entered
	 * each implementation of the interface 
	 * will use an institution's local resources to validate the credentials provided by the user.
	 * @param username
	 * @param password
	 * @return true if passed credentials were successfully validated
	 */
	public boolean authenticate(String username, String password);

	/**
	 * should users that are not logged in be presented with a login form
	 * if an institution is, for example,  exclusively using certificate based authentication, 
	 *   this function should return false
	 * @return
	 */
	public boolean allowFormBasedAuthentiation();
	
}
